package com.zzh.interview.utils;

import java.util.Random;

/**
 * @author 张 志 豪
 * @version 1.0
 * 6位数字验证码生成
 */
public class CodeUtils {
    public static String getCodeToSix(){
        //生成一个6位的随机码
        Random random = new Random();
        StringBuilder code = new StringBuilder();
        for (int i = 0; i < 6; i++) {
            code.append(random.nextInt(10));
        }
        return code.toString();
    }
}
